#!/bin/sh
source /root/.bash_profile

usage()
{
    echo "usage: n--->normal | k--->kill"
}

normal_close()
{
    DAEMONPID=`ps -ef |grep poker |grep ./daemon |awk '{print $2}'`
    echo "daemon pid: $DAEMONPID"
    /bin/kill -22 $DAEMONPID
}

kill_force()
{
    /bin/kill -9 `ps -ef |grep poker |awk '{print $2}'`
}

case "$1" in
    n)
        normal_close;;
    k)
        kill_force;;
    *)
        usage;;
esac
